/**
 * A C interface to mmseg-cpp. Will be compiled to a
 * shared library.
 */

#include "token.h"
#include "dict.h"
#include "algor.h"

extern "C" {
    
struct Token {
    const char *text;
    int offset;
    int length;
};

int mmseg_load_chars(const char *path);

int mmseg_load_words(const char *path);

void mmseg_dic_add(const char *word, int len, int freq);

rmmseg::Algorithm *mmseg_algor_create(const char *text, int len);

void mmseg_algor_destroy(rmmseg::Algorithm *algor);

Token mmseg_next_token(rmmseg::Algorithm *algor);

}
